package com.yaoq.proxy.interceptor;

import java.lang.reflect.Proxy;

/**
 * @ClassName ProxyFactory
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/9/2 11:50
 * @Version 1.0
 */
public class ProxyFactory {
    public static Object getProxy(Object target) {
        PackageWork packageWork = new PackageWork();
        packageWork.setYao(target);
        Object proxy = Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), packageWork);
        return proxy;
    }
}
